namespace sy1_7
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }

        private void Form1_Load(object sender, EventArgs e)
        {

            pbImage.Width = 240;
            pbImage.Height = 180;

            btnEnlarge.Enabled = false;
        }

        private void btnShrink_Click(object sender, EventArgs e)
        {

            int newWidth = pbImage.Width - 24;
            int newHeight = pbImage.Height - 18;

            pbImage.Width = newWidth;
            pbImage.Height = newHeight;

            btnEnlarge.Enabled = true;

            if (newWidth == 24 && newHeight == 18)
            {
                btnShrink.Enabled = false;
            }
        }

        private void btnEnlarge_Click(object sender, EventArgs e)
        {

            int newWidth = pbImage.Width + 24;
            int newHeight = pbImage.Height + 18;

            pbImage.Width = newWidth;
            pbImage.Height = newHeight;

            btnShrink.Enabled = true;

            if (newWidth == 240 && newHeight == 180)
            {
                btnEnlarge.Enabled = false;
            }
        }
    }
}
